
using System;
using System.Reflection;
using QdbUnit;
using QdbUnit.Extensions;

namespace Qdb.Tests.CLI2.Assorted
{
	class AssemblyInfoTestCase : ITestCase, IOptOutSilverlight
	{
		public void Test()
		{
			Type[] assemblyReferences = new Type[]
				{
					typeof(QdbFactory),
#if !SILVERLIGHT
					typeof(Qdb.Instrumentation.Api.ITypeEditor),
					typeof(Qdb.NativeQueries.NQOptimizer),
#endif
				};
			foreach (Type type in assemblyReferences)
			{
				AssemblyName assemblyName = type.Assembly.GetName();
				Assert.AreEqual(ExpectedVersion(), assemblyName.Version, assemblyName.FullName);
				Assert.AreNotEqual(0, assemblyName.GetPublicKeyToken().Length, assemblyName.FullName);
			}
		}

		private static Version ExpectedVersion()
		{
			return new Version(QdbVersion.Major, QdbVersion.Minor, QdbVersion.Iteration, QdbVersion.Revision);
		}
	}
}
